home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / DigitalSignature.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  18.7 KB  |  501 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        DigitalSignature.a
  3. ;
  4. ;    Contains:    Digital Signature Interfaces.
  5. ;
  6. ;    Version:    Technology:    AOCE toolbox 1.02
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__DIGITALSIGNATURE__') = 'UNDEFINED' THEN
  19. __DIGITALSIGNATURE__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31. ;  values of SIGNameAttributeType 
  32.  
  33. kSIGCountryCode                    EQU        0
  34. kSIGOrganization                EQU        1
  35. kSIGStreetAddress                EQU        2
  36. kSIGState                        EQU        3
  37. kSIGLocality                    EQU        4
  38. kSIGCommonName                    EQU        5
  39. kSIGTitle                        EQU        6
  40. kSIGOrganizationUnit            EQU        7
  41. kSIGPostalCode                    EQU        8
  42. ; typedef unsigned short                 SIGNameAttributeType
  43.  
  44. ;  
  45. ;Certificate status codes returned in SIGCertInfo or SIGSignerInfo from
  46. ;either SIGGetCertInfo or SIGGetSignerInfo respectively. kSIGValid means that
  47. ;the certificate is currently valid. kSIGPending means the certificate is
  48. ;currently not valid - but will be.  kSIGExpired means the certificate has
  49. ;expired. A time is always associated with a SIGCertStatus.  In each case the
  50. ;time has a specific interpretation.  When the status is kSIGValid the time is
  51. ;when the certificate will expire. When the status is kSIGPending the time is
  52. ;when the certificate will become valid. When the status is kSIGExpired the time
  53. ;is when the certificate expired. In the SIGCertInfo structure, the startDate
  54. ;and endDate fields hold the appropriate date information.  In the SIGSignerInfo
  55. ;structure, this information is provided in the certSetStatusTime field. In the
  56. ;SIGSignerInfo struct, the status time is actually represented by the SIGSignatureStatus
  57. ;field which can contain any of the types below. NOTE: The only time you will get 
  58. ;a kSIGInvalid status is when it pertains to a SIGSignatureStatus field and only when
  59. ;you get a signature that was created after the certificates expiration date, something
  60. ;we are not allowing on the Mac but that may not be restricted on other platforms. Also, 
  61. ;it will not be possible to get a kSIGPending value for SIGSignatureStatus on the Mac but
  62. ;possibly allowed by other platforms.
  63. ;
  64.  
  65. ;  Values for SIGCertStatus or SIGSignatureStatus 
  66.  
  67. kSIGValid                        EQU        0                    ; possible for either a SIGCertStatus or SIGSignatureStatus 
  68. kSIGPending                        EQU        1                    ; possible for either a SIGCertStatus or SIGSignatureStatus 
  69. kSIGExpired                        EQU        2                    ; possible for either a SIGCertStatus or SIGSignatureStatus * possible only for a SIGSignatureStatus 
  70. kSIGInvalid                        EQU        3
  71. ; typedef unsigned short                 SIGCertStatus
  72.  
  73. ; typedef unsigned short                 SIGSignatureStatus
  74.  
  75. ;  Number of bytes needed for a digest record when using SIGDigest 
  76.  
  77. kSIGDigestSize                    EQU        16
  78. SIGDigestData            RECORD 0
  79. elements                 ds.b    16
  80. sizeof                     EQU *                    ; size:   $10 (16)
  81.                         ENDR
  82.  
  83.  
  84. ; typedef Byte *                        SIGDigestDataPtr
  85.  
  86. SIGCertInfo                RECORD 0
  87. startDate                 ds.l    1                ; offset: $0 (0)        ;  cert start validity date 
  88. endDate                     ds.l    1                ; offset: $4 (4)        ;  cert end validity date 
  89. certStatus                 ds.w    1                ; offset: $8 (8)        ;  see comment on SIGCertStatus for definition 
  90. certAttributeCount         ds.l    1                ; offset: $A (10)        ;  number of name attributes in this cert 
  91. issuerAttributeCount     ds.l    1                ; offset: $E (14)        ;  number of name attributes in this certs issuer 
  92. serialNumber             ds        Str255            ; offset: $12 (18)        ;  cert serial number 
  93. sizeof                     EQU *                    ; size:   $112 (274)
  94.                         ENDR
  95. ; typedef struct SIGCertInfo *            SIGCertInfoPtr
  96.  
  97. SIGSignerInfo            RECORD 0
  98. signingTime                 ds.l    1                ; offset: $0 (0)        ;  time of signing 
  99. certCount                 ds.l    1                ; offset: $4 (4)        ;  number of certificates in the cert set 
  100. certSetStatusTime         ds.l    1                ; offset: $8 (8)        ;  Worst cert status time. See comment on SIGCertStatus for definition 
  101. signatureStatus             ds.w    1                ; offset: $C (12)        ;  The status of the signature. See comment on SIGCertStatus for definition
  102. sizeof                     EQU *                    ; size:   $E (14)
  103.                         ENDR
  104. ; typedef struct SIGSignerInfo *        SIGSignerInfoPtr
  105.  
  106. SIGNameAttributesInfo    RECORD 0
  107. onNewLevel                 ds.b    1                ; offset: $0 (0)
  108. filler1                     ds.b    1                ; offset: $1 (1)
  109. attributeType             ds.w    1                ; offset: $2 (2)
  110. attributeScript             ds.w    1                ; offset: $4 (4)
  111. attribute                 ds        Str255            ; offset: $6 (6)
  112. sizeof                     EQU *                    ; size:   $106 (262)
  113.                         ENDR
  114. ; typedef struct SIGNameAttributesInfo * SIGNameAttributesInfoPtr
  115.  
  116. ; typedef Ptr                             SIGContextPtr
  117.  
  118. ; typedef Ptr                             SIGSignaturePtr
  119.  
  120. ;Certificates are always in order. That is, the signers cert is always 0, the
  121. ;issuer of the signers cert is always 1 etc… to the number of certificates-1.
  122. ;You can use this constant for readability in your code.
  123. ;
  124.  
  125.  
  126. kSIGSignerCertIndex                EQU        0
  127. ;Call back procedure supplied by developer, return false to cancel the current
  128. ;process.
  129. ;
  130.  
  131. ;Resource id's of standard signature icon suite, all sizes and colors are available.
  132. ;
  133.  
  134.  
  135. kSIGSignatureIconResID            EQU        -16797
  136. kSIGValidSignatureIconResID        EQU        -16799
  137. kSIGInvalidSignatureIconResID    EQU        -16798
  138. ;  ——————————————————————————————— CONTEXT CALLS ——————————————————————————————— 
  139. ;To use the Digital Signature toolbox you will need a SIGContextPtr.  To create
  140. ;a SIGContextPtr you simply call SIGNewContext and it will create and initialize
  141. ;a context for you.  To free the memory occupied by the context and invalidate
  142. ;its internal data, call SIGDisposeContext. An initialized context has no notion
  143. ;of the type of operation it will be performing however, once you call
  144. ;SIGSignPrepare SIGVerifyPrepare, or SIGDigestPrepare, the contexts operation
  145. ;type is set and to switch  to another type of operation will require creating a
  146. ;new context. Be sure to pass the same context to corresponding toolbox calls
  147. ;(ie SIGSignPrepare, SIGProcessData, SIGSign)  in other words mixing lets say
  148. ;signing and verify calls with the same context is not allowed.
  149. ;
  150.  
  151. ;
  152. ; pascal OSErr SIGNewContext(SIGContextPtr *context)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  155.         Macro
  156.         _SIGNewContext
  157.             move.l              #$0002076C,D0
  158.             dc.w                $AA5D
  159.         EndM
  160.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  161.         IMPORT_CFM_FUNCTION SIGNewContext
  162.     ENDIF
  163.  
  164. ;
  165. ; pascal OSErr SIGDisposeContext(SIGContextPtr context)
  166. ;
  167.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  168.         Macro
  169.         _SIGDisposeContext
  170.             move.l              #$0002076D,D0
  171.             dc.w                $AA5D
  172.         EndM
  173.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  174.         IMPORT_CFM_FUNCTION SIGDisposeContext
  175.     ENDIF
  176.  
  177.  
  178. ;  ——————————————————————————————— SIGNING CALLS ——————————————————————————————— 
  179. ;Once you have created a SIGContextPtr, you create a signature by calling
  180. ;SIGSignPrepare once, followed by n calls to SIGProcessData, followed by one call
  181. ;toRcpt SIGSign. To create another signature on different data but for the same
  182. ;signer, don't dispose of the context and call SIGProcessData for the new data
  183. ;followed by a call SIGSign again. In this case the signer will not be prompted
  184. ;for their signer and password again as it was already provided.  Once you call
  185. ;SIGDisposeContext, all signer information will be cleared out of the context and
  186. ;the signer will be re-prompted.  The signer file FSSpecPtr should be set to nil
  187. ;if you want the toolbox to use the last signer by default or prompt for a signer
  188. ;if none exists.  The prompt parameter can be used to pass a string to be displayed
  189. ;in the dialog that prompts the user for their password.  If the substring "^1"
  190. ;(without the quotes) is in the prompt string, then the toolbox will replace it
  191. ;with the name of the signer from the signer selected by the user.  If an empty
  192. ;string is passed, the following default string will be sent to the toolbox
  193. ;"\pSigning as ^1.".  You can call any of the utility routines after SIGSignPrepare
  194. ;or SIGSign to get information about the signer or certs.
  195. ;
  196.  
  197. ;
  198. ; pascal OSErr SIGSignPrepare(SIGContextPtr context, const FSSpec *signerFile, ConstStr255Param prompt, Size *signatureSize)
  199. ;
  200.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  201.         Macro
  202.         _SIGSignPrepare
  203.             move.l              #$0008076E,D0
  204.             dc.w                $AA5D
  205.         EndM
  206.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  207.         IMPORT_CFM_FUNCTION SIGSignPrepare
  208.     ENDIF
  209.  
  210. ;
  211. ; pascal OSErr SIGSign(SIGContextPtr context, SIGSignaturePtr signature, SIGStatusProcPtr statusProc)
  212. ;
  213.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  214.         Macro
  215.         _SIGSign
  216.             move.l              #$0006076F,D0
  217.             dc.w                $AA5D
  218.         EndM
  219.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  220.         IMPORT_CFM_FUNCTION SIGSign
  221.     ENDIF
  222.  
  223.  
  224. ;  ——————————————————————————————— VERIFYING CALLS ——————————————————————————————— 
  225. ;Once you have created a SIGContextPtr, you verify a signature by calling
  226. ;SIGVerifyPrepare  once, followed by n calls to SIGProcessData, followed by one
  227. ;call to SIGVerify. Check the return code from SIGVerify to see if the signature
  228. ;verified or not (noErr is returned on  success otherwise the appropriate error
  229. ;code).  Upon successfull verification, you can call any of the utility routines
  230. ;toRcpt find out who signed the data.
  231. ;
  232.  
  233. ;
  234. ; pascal OSErr SIGVerifyPrepare(SIGContextPtr context, SIGSignaturePtr signature, Size signatureSize, SIGStatusProcPtr statusProc)
  235. ;
  236.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  237.         Macro
  238.         _SIGVerifyPrepare
  239.             move.l              #$00080770,D0
  240.             dc.w                $AA5D
  241.         EndM
  242.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION SIGVerifyPrepare
  244.     ENDIF
  245.  
  246. ;
  247. ; pascal OSErr SIGVerify(SIGContextPtr context)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  250.         Macro
  251.         _SIGVerify
  252.             move.l              #$00020771,D0
  253.             dc.w                $AA5D
  254.         EndM
  255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION SIGVerify
  257.     ENDIF
  258.  
  259. ;  —————————————————————————————— DIGESTING CALLS —————————————————————————————— 
  260. ;Once you have created a SIGContextPtr, you create a digest by calling
  261. ;SIGDigestPrepare once, followed by n calls to SIGProcessData, followed by one
  262. ;call to SIGDigest.  You can dispose of the context after SIGDigest as the
  263. ;SIGDigestData does not reference back into it.  SIGDigest returns the digest in
  264. ;digest.
  265. ;
  266.  
  267. ;
  268. ; pascal OSErr SIGDigestPrepare(SIGContextPtr context)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  271.         Macro
  272.         _SIGDigestPrepare
  273.             move.l              #$00020772,D0
  274.             dc.w                $AA5D
  275.         EndM
  276.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION SIGDigestPrepare
  278.     ENDIF
  279.  
  280. ;
  281. ; pascal OSErr SIGDigest(SIGContextPtr context, SIGDigestData digest)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  284.         Macro
  285.         _SIGDigest
  286.             move.l              #$00040773,D0
  287.             dc.w                $AA5D
  288.         EndM
  289.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION SIGDigest
  291.     ENDIF
  292.  
  293.  
  294. ;  —————————————————————————————— PROCESSING DATA —————————————————————————————— 
  295. ;To process data during a digest, sign, or verify operation call SIGProcessData
  296. ;as many times as necessary and with any sized blocks of data.  The data needs to
  297. ;be processed in the same order during corresponding sign and verify operations
  298. ;but does not need to be processed in the same sized chunks (i.e., the toolbox
  299. ;just sees it as a continuous bit stream).
  300. ;
  301.  
  302. ;
  303. ; pascal OSErr SIGProcessData(SIGContextPtr context, const void *data, Size dataSize)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  306.         Macro
  307.         _SIGProcessData
  308.             move.l              #$00060774,D0
  309.             dc.w                $AA5D
  310.         EndM
  311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION SIGProcessData
  313.     ENDIF
  314.  
  315.  
  316. ;  ——————————————————————————————— UTILITY CALLS ——————————————————————————————— 
  317. ;Given a context that has successfully performed a verification SIGShowSigner
  318. ;will  display a modal dialog with the entire distinguished name of the person
  319. ;who signed the data. the prompt (if supplied) will appear at the top of the
  320. ;dialog.  If no prompt is specified, the default prompt "\pVerification
  321. ;Successfull." will appear.
  322. ;
  323. ;Given a context that has been populated by calling SIGSignPrepare, SIGSign or a
  324. ;successful SIGVerify, you can make the remaining utility calls:
  325. ;
  326. ;SIGGetSignerInfo will return the SignerInfo record.  The certCount can be used
  327. ;toRcpt index into the certificate set when calling SIGGetCertInfo,
  328. ;SIGGetCertNameAttributes or SIGGetCertIssuerNameAttributes. The signingTime is
  329. ;only defined if the call is made after SIGSign  or SIGVerify. The certSetStatus
  330. ;will tell you the best status of the entire certificate set while
  331. ;certSetStatusTime will correspond to the time associated with that status (see
  332. ;definitions above).
  333. ;
  334. ;SIGGetCertInfo will return the SIGCertInfo record when given a valid index into
  335. ;the cert set in  certIndex.  Note: The cert at index kSIGSignerCertIndex is
  336. ;always the signers certificate.  The  serial number, start date and end date
  337. ;are there should you wish to display that info.  The  certAttributeCount and
  338. ;issuerAttributeCount provide the number of parts in the name of that certificate
  339. ;or that certificates issuer respectively.  You use these numbers to index into
  340. ;either SIGGetCertNameAttributes or SIGGetCertIssuerNameAttributes to retrieve
  341. ;the name. The certStatus will tell you the status of the certificate while
  342. ;certStatusTime will correspond to the time associated with that status (see
  343. ;definitions above).
  344. ;
  345. ;SIGGetCertNameAttributes and SIGGetCertIssuerNameAttributes return name parts
  346. ;of the certificate at  certIndex and attributeIndex.  The newLevel return value
  347. ;tells you wether the name attribute returned is at the same level in the name
  348. ;hierarchy as the previous attribute.  The type return value tells you  the type
  349. ;of attribute returned. nameAttribute is the actual string containing the name
  350. ;attribute.   So, if you wanted to display the entire distinguished name of the
  351. ;person who's signature was just validated you could do something like this;
  352. ;
  353. ;    (…… variable declarations and verification code would preceed this sample ……)
  354. ;
  355. ;    error = SIGGetCertInfo(verifyContext, kSIGSignerCertIndex, &certInfo);
  356. ;    HandleErr(error);
  357. ;
  358. ;    for (i = 0; i <= certInfo.certAttributeCount-1; i++)
  359. ;        {
  360. ;        error = SIGGetCertNameAttributes(
  361. ;            verifyContext, kSIGSignerCertIndex, i, &newLevel, &type, theAttribute);
  362. ;        HandleErr(error);
  363. ;        DisplayNamePart(theAttribute, type, newLevel);
  364. ;        }
  365. ;
  366.  
  367. ;
  368. ; pascal OSErr SIGShowSigner(SIGContextPtr context, ConstStr255Param prompt)
  369. ;
  370.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  371.         Macro
  372.         _SIGShowSigner
  373.             move.l              #$00040775,D0
  374.             dc.w                $AA5D
  375.         EndM
  376.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  377.         IMPORT_CFM_FUNCTION SIGShowSigner
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal OSErr SIGGetSignerInfo(SIGContextPtr context, SIGSignerInfo *signerInfo)
  382. ;
  383.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  384.         Macro
  385.         _SIGGetSignerInfo
  386.             move.l              #$00040776,D0
  387.             dc.w                $AA5D
  388.         EndM
  389.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  390.         IMPORT_CFM_FUNCTION SIGGetSignerInfo
  391.     ENDIF
  392.  
  393. ;
  394. ; pascal OSErr SIGGetCertInfo(SIGContextPtr context, unsigned long certIndex, SIGCertInfo *certInfo)
  395. ;
  396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  397.         Macro
  398.         _SIGGetCertInfo
  399.             move.l              #$00060777,D0
  400.             dc.w                $AA5D
  401.         EndM
  402.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  403.         IMPORT_CFM_FUNCTION SIGGetCertInfo
  404.     ENDIF
  405.  
  406. ;
  407. ; pascal OSErr SIGGetCertNameAttributes(SIGContextPtr context, unsigned long certIndex, unsigned long attributeIndex, SIGNameAttributesInfo *attributeInfo)
  408. ;
  409.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  410.         Macro
  411.         _SIGGetCertNameAttributes
  412.             move.l              #$00080778,D0
  413.             dc.w                $AA5D
  414.         EndM
  415.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  416.         IMPORT_CFM_FUNCTION SIGGetCertNameAttributes
  417.     ENDIF
  418.  
  419. ;
  420. ; pascal OSErr SIGGetCertIssuerNameAttributes(SIGContextPtr context, unsigned long certIndex, unsigned long attributeIndex, SIGNameAttributesInfo *attributeInfo)
  421. ;
  422.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  423.         Macro
  424.         _SIGGetCertIssuerNameAttributes
  425.             move.l              #$00080779,D0
  426.             dc.w                $AA5D
  427.         EndM
  428.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION SIGGetCertIssuerNameAttributes
  430.     ENDIF
  431.  
  432.  
  433.  
  434. ;  ——————————————————————————— FILE SIGN & VERIFY CALLS —————————————————————————— 
  435. ;These calls allow you to detect the presence of a standard signtaure in a file as 
  436. ;well as sign and verify files in a standard way.  An example of this is the Finder, 
  437. ;which uses these calls to allow the user to "drop sign" a file.
  438. ;
  439. ;To detect if a file is signed in the standard way, pass the FSSpec of the file to SIGFileIsSigned.
  440. ;A result of noErr means the file is in fact signed, otherwise, a kSIGNoSignature error will
  441. ;be returned.
  442. ;
  443. ;Once you have created a SIGContextPtr, you can make calls to either sign or verify a file in
  444. ;a standard way: 
  445. ;
  446. ;To sign a file, call SIGSignPrepare followed by 'n' number of calls to SIGSignFile,
  447. ;passing it the file spec for each file you wish to sign in turn.  You supply the context, the signature 
  448. ;size that was returned from SIGSignPrepare and an optional call back proc.  The call will take care of all
  449. ;the processing of data and affixing the signature to the file. If a signature already exists in the file, 
  450. ;it is replaced with the newly created signature.
  451. ;
  452. ;To verify a file that was signed using SIGSignFile, call SIGVerifyFile passing it a new context and 
  453. ;the file spec.  Once this call has completed, if the verification is successfull, you can pass the context 
  454. ;to SIGShowSigner to display the name of the person who signed the file.
  455. ;
  456.  
  457. ;
  458. ; pascal OSErr SIGFileIsSigned(const FSSpec *fileSpec)
  459. ;
  460.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  461.         Macro
  462.         _SIGFileIsSigned
  463.             move.l              #$000209C4,D0
  464.             dc.w                $AA5D
  465.         EndM
  466.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  467.         IMPORT_CFM_FUNCTION SIGFileIsSigned
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal OSErr SIGSignFile(SIGContextPtr context, Size signatureSize, const FSSpec *fileSpec, SIGStatusProcPtr statusProc)
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  474.         Macro
  475.         _SIGSignFile
  476.             move.l              #$000809C5,D0
  477.             dc.w                $AA5D
  478.         EndM
  479.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  480.         IMPORT_CFM_FUNCTION SIGSignFile
  481.     ENDIF
  482.  
  483. ;
  484. ; pascal OSErr SIGVerifyFile(SIGContextPtr context, const FSSpec *fileSpec, SIGStatusProcPtr statusProc)
  485. ;
  486.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  487.         Macro
  488.         _SIGVerifyFile
  489.             move.l              #$000609C6,D0
  490.             dc.w                $AA5D
  491.         EndM
  492.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  493.         IMPORT_CFM_FUNCTION SIGVerifyFile
  494.     ENDIF
  495.  
  496.     ENDIF ; __DIGITALSIGNATURE__ 
  497.  
  498.